$(function(){
    var id = $("#hId").val();
    var RecMsg =$.ajax({
        url: "selectLetters/"+ id ,
        post:"GET",
        date:id
    })
    var notice = $('<li><a href="#"><img src="images/avatar2.jpg" alt="avatar" /><span class="date pull-right">时间</span><span class="name">Daniel</span><span>文章简介</span></a></li>')
    RecMsg.done(function (result) {
        console.log(result)
        var count = result.extend.count
        var span = $(".button").find(".bubble");
        if (result.extend.count == 0){
            span.remove();
        }else{
            span.text(count);
        }
        var data = result.extend.letterList;
        for(var i = 0;i < count>3?3:count ;i++ ){
            var temp = notice.clone(false);
            var src = data[i].writerUser.picture;
            temp.find("img").attr("src",src);
            temp.find("span").eq(0).text(data[i].sendTime);
            temp.find("span").eq(1).text(data[i].writerUser.nickName);
            temp.find("span").eq(2).text(data[i].content);
            $(".content1 ul").append(temp);
        }

    })
})
function recommendArticle() {

}